﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adams.Public.Web.Business.Web.Areas.Membership.Donations
{
    public class Index
    {
        public static Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.PageLoad PageLoad(string token)
        {
            var input = new Adams.Public.DataTransfer.MemberInfo() { 
                Token = token
            };

            var data = Api.GetData<Adams.Public.DataTransfer.Donations.GetDonations>("Donations/GetDonations", input);

            var model = new Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.PageLoad();
            model.OneTimes = data.OneTimes;
            model.Recurrings = data.Recurrings;

            return model;
        }

        public static Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelOutput CancelDonation(Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelInput input)
        {
            var model = Api.GetData<Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelOutput>("Donations/CancelDonation", input);
            return model;
        }

        public static Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelRecurringOutput CancelRecurringDonation(Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelRecurringInput input)
        {
            var model = Api.GetData<Adams.Public.DataTransfer.Web.Areas.Membership.Donations.Index.CancelRecurringOutput>("Donations/CancelRecurringDonation", input);
            return model;
        }
    }
}
